<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>统计</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link href="../static/css/main/animate.min.css" th:href="@{/css/main/animate.min.css}" rel="stylesheet"/>
    <link href="../static/css/main/style.min862f.css" th:href="@{/css/main/style.min862f.css}" rel="stylesheet"/>
</head>
<style>
    h1{
        text-align: center;
        font-weight: 700;
        font-size: 50px !important;
        margin-top: 10%;
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">

    <div class="row">
        <div class="col-sm-12">
            <h1>欢迎使用金鹏报表系统</h1>
        </div>
    </div>
</div>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/ajax/libs/flot/jquery.flot.js}"></script>
<th:block th:include="include :: echarts-js"/>
<th:block th:include="include :: sparkline-js"/>
<script type="text/javascript">
    var barChart = echarts.init(document.getElementById("mychart"));
    option = {
        grid: {
            y: 15,
        },
        xAxis: {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
            type: 'value'
        },
        series: [{
            data: [520, 200, 150, 80, 70, 110, 130],
            type: 'bar',
            showBackground: true,
            itemStyle: {
                normal: {
                    color: '#FF7F50'
                }
            }

        }]
    };
    barChart.setOption(option);
    setTimeout(function () {
        window.onresize = function () {
            barChart.resize();
        }
    }, 200)


    // function Initialization(year) {
    //     if (year == 'undefined' || year == null) {
    //         var myDate = new Date();
    //         GetData(myDate.getFullYear());
    //     } else {
    //         GetData(year);
    //     }
    // }

    function GetData(year) {
        var nums = [];
        $.ajax({
            async: false,
            url: "/jinpeng/findEcData",
            data: {
                "year": year
            },
            type: "post",
            dataType: "json",
            success: function (data) {
                if (data) {
                    for (var i = 0; i < data.length; i++) {
                        nums.push(data[i]);
                    }
                    barChart.hideLoading(); //隐藏加载动画
                    barChart.setOption({ //加载数据图表
                        series: [{
                            // 根据名字对应到相应的系列
                            name: '人员数量',
                            data: nums
                        }]
                    });
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {

                alert("错误,请联系管理员,错误信息:" + textStatus);
            }
        });
    }
</script>
</body>
</html>
